<?php


namespace app\common\validate;

use think\facade\Request;
use think\Validate;

class BaseValidate extends Validate
{
    public function goCheck()
    {
        // 获取http传入的参数
        // 对这些参数做校验
        $request = Request::instance();
        $result = $this->check($request->param());

        if (!$result) {
            echo json_encode(['status'=>0,'message'=>$this->getError()],JSON_UNESCAPED_UNICODE);
            exit();
        } else {
            return true;
        }
    }
}
